#include<iostream>

#include<stdio.h>

#include <pthread.h>

#include<unistd.h>

#include<string>

using namespace std;

void* my_thread_1(void* arg)
{
    cout << "我是线程1\n";
    string* str = new string("hello linux");
    sleep(3);
    return (void*)str;
}

int main()
{
    pthread_t PT;
    pthread_create(&PT, nullptr, my_thread_1, nullptr);

    cout << "我是主线程\n";

    void* ret;
    sleep(1);
    exit(0);
    pthread_join(PT, &ret);

    string* Ret = static_cast<string*> (ret);

    cout << *Ret << endl;

    delete(Ret);

    return 0;
}